context = g_main_context_new ();
- sysroot_f = ot_gfile_new_for_path ("/sysroot/ostree/current");
+ sysroot_f = g_file_new_for_path ("/sysroot/ostree/current");
g_main_context_push_thread_default (context);
OverlayDirThreadData *tdata = g_new0 (OverlayDirThreadData, 1);
tdata->op = op;
- tdata->dir = ot_gfile_new_for_path (dir);
+ tdata->dir = g_file_new_for_path (dir);
#if GLIB_CHECK_VERSION(2,32,0) && !defined(OSTREE_GLIB_TARGET_MIN)
g_thread_new ("overlay-dir-thread", overlay_dir_thread, tdata);
}
if (is_dummy)
- self->prefix = ot_gfile_new_for_path (config->dummy_test_path);
+ self->prefix = g_file_new_for_path (config->dummy_test_path);
else
- self->prefix = ot_gfile_new_for_path ("/sysroot/ostree");
+ self->prefix = g_file_new_for_path ("/sysroot/ostree");
self->name_id = g_bus_own_name (is_dummy ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM,
OSTREE_DAEMON_NAME,
{
case PROP_PATH:
/* Canonicalize */
- self->repodir = ot_gfile_new_for_path (ot_gfile_get_path_cached (g_value_get_object (value)));
+ self->repodir = g_file_new_for_path (ot_gfile_get_path_cached (g_value_get_object (value)));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
if (parent_repo_path && parent_repo_path[0])
{
- ot_lobj GFile *parent_repo_f = ot_gfile_new_for_path (parent_repo_path);
+ ot_lobj GFile *parent_repo_f = g_file_new_for_path (parent_repo_path);
self->parent_repo = ostree_repo_new (parent_repo_f);
if (root)
triggerdir = g_file_resolve_relative_path (root, rel_triggerdir);
else
- triggerdir = ot_gfile_new_for_path (rel_triggerdir);
+ triggerdir = g_file_new_for_path (rel_triggerdir);
if (g_file_query_exists (triggerdir, cancellable))
{
return ret;
}
-/* Like g_file_new_for_path, but only do local stuff, not GVFS */
-GFile *
-ot_gfile_new_for_path (const char *path)
-{
- return g_vfs_get_file_for_path (g_vfs_get_local (), path);
-}
-
const char *
ot_gfile_get_path_cached (GFile *file)
{
GFile *ot_gfile_get_child_strconcat (GFile *parent, const char *first, ...) G_GNUC_NULL_TERMINATED;
-GFile *ot_gfile_new_for_path (const char *path);
-
const char *ot_gfile_get_path_cached (GFile *file);
const char *ot_gfile_get_basename_cached (GFile *file);
}
else
{
- ot_lobj GFile *f = ot_gfile_new_for_path (opt_from_file);
+ ot_lobj GFile *f = g_file_new_for_path (opt_from_file);
instream = (GInputStream*)g_file_read (f, cancellable, error);
if (!instream)
}
destination = argv[1];
- checkout_target = ot_gfile_new_for_path (destination);
+ checkout_target = g_file_new_for_path (destination);
if (!process_many_checkouts (repo, checkout_target, cancellable, error))
goto out;
GError *temp_error = NULL;
suffixed_destination = g_strconcat (destination, "-", resolved_commit, NULL);
- checkout_target = ot_gfile_new_for_path (suffixed_destination);
+ checkout_target = g_file_new_for_path (suffixed_destination);
tmp_destination = g_strconcat (suffixed_destination, ".tmp", NULL);
- checkout_target_tmp = ot_gfile_new_for_path (tmp_destination);
- symlink_target = ot_gfile_new_for_path (destination);
+ checkout_target_tmp = g_file_new_for_path (tmp_destination);
+ symlink_target = g_file_new_for_path (destination);
if (!parse_commit_from_symlink (symlink_target, &existing_commit,
cancellable, &temp_error))
}
else
{
- checkout_target = ot_gfile_new_for_path (destination);
+ checkout_target = g_file_new_for_path (destination);
skip_checkout = FALSE;
}
goto out;
if (argc > 1)
- f = ot_gfile_new_for_path (argv[1]);
+ f = g_file_new_for_path (argv[1]);
else
{
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
ot_lfree char *contents = NULL;
char **lines = NULL;
- path = ot_gfile_new_for_path (statoverride_file);
+ path = g_file_new_for_path (statoverride_file);
if (!g_file_load_contents (path, cancellable, &contents, &len, NULL,
error))
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(say)"));
builder_initialized = TRUE;
- path = ot_gfile_new_for_path (opt_related_objects_file);
+ path = g_file_new_for_path (opt_related_objects_file);
if (!g_file_load_contents (path, cancellable, &contents, &len, NULL,
error))
}
else if (metadata_bin_path)
{
- metadata_f = ot_gfile_new_for_path (metadata_bin_path);
+ metadata_f = g_file_new_for_path (metadata_bin_path);
if (!ot_util_variant_map (metadata_f, G_VARIANT_TYPE ("a{sv}"), TRUE,
&metadata, error))
goto out;
if (argc == 1 && (trees == NULL || trees[0] == NULL))
{
char *current_dir = g_get_current_dir ();
- arg = ot_gfile_new_for_path (current_dir);
+ arg = g_file_new_for_path (current_dir);
g_free (current_dir);
if (!ostree_repo_stage_directory_to_mtree (repo, arg, mtree, modifier,
g_clear_object (&arg);
if (strcmp (tree_type, "dir") == 0)
{
- arg = ot_gfile_new_for_path (tree);
+ arg = g_file_new_for_path (tree);
if (!ostree_repo_stage_directory_to_mtree (repo, arg, mtree, modifier,
cancellable, error))
goto out;
}
else if (strcmp (tree_type, "tar") == 0)
{
- arg = ot_gfile_new_for_path (tree);
+ arg = g_file_new_for_path (tree);
if (!ostree_repo_stage_archive_to_mtree (repo, arg, mtree, modifier,
tar_autocreate_parents,
cancellable, error))
|| g_str_has_prefix (arg, "./")
)
{
- ret_file = ot_gfile_new_for_path (arg);
+ ret_file = g_file_new_for_path (arg);
}
else
{
target = argv[2];
}
- cwd = ot_gfile_new_for_path (".");
+ cwd = g_file_new_for_path (".");
if (!parse_file_or_commit (repo, src, &srcf, cancellable, error))
goto out;
}
src_repo_path = argv[1];
- src_f = ot_gfile_new_for_path (src_repo_path);
+ src_f = g_file_new_for_path (src_repo_path);
data.src_repo = ostree_repo_new (src_f);
if (!ostree_repo_check (data.src_repo, error))
ot_lobj GFile *f = NULL;
ot_lvariant GVariant *variant = NULL;
- f = ot_gfile_new_for_path (filename);
+ f = g_file_new_for_path (filename);
if (!ot_util_variant_map (f, type, TRUE, &variant, error))
goto out;
repo = NULL;
if (repo)
- repo_file = ot_gfile_new_for_path (repo);
+ repo_file = g_file_new_for_path (repo);
slash = strrchr (argv[0], '/');
if (slash)